package com.example.huaxindemo2.mapper;

import com.example.huaxindemo2.entity.Pr103en;
import com.example.huaxindemo2.entity.T001;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;
import java.util.Set;

@Mapper
public interface T001Mapper {
    @Select("select * from t001")
    public List<T001> SelectAll();

    @Select("select SUBSTR(t00102,1,4) from t001") //找订单时间
    public Set<String> SelectDate();

    @Select("SELECT * FROM `t001` WHERE SUBSTR(t00102,1,7) = #{strDate} ")
    public List<T001> SelectDateAll(String strDate);

    @Select("SELECT DISTINCT m001.m00101,m001.m00103,t002.t00203*t002.t00204 AS amount FROM m001,t001,t002 WHERE SUBSTR(t001.t00102,1,7) = #{strDate} AND t001.t00105=m001.m00101 GROUP BY m001.m00101,m001.m00103,t002.t00203 * t002.t00204")
    public List<Pr103en> SelectCustomerAmount(@Param("strDate") String strDate);
}
